package behavioral.interpreter;

/**
 * 上下文角色：一般用于保存符合文法的字符串及其对应的状态
 */
public class Context {

    private String[] m_arrToken;
    private int m_iPos;

    public Context(String strContent) {
        m_iPos = 0;
        m_arrToken = strContent.split(" ");
    }

    public String nextToken() {
        return m_arrToken[m_iPos++];
    }

}
